<?php
@session_start();
require_once('../config/config.php');
require_once('../utils/CommonUtils.php');
require_once('../utils/DBUtils.php');
include ("../utils/Constants.php");
require_once('../utils/BaseDAO.php');
require("../utils/Session.php");

$commonUtils = new CommonUtils();
$baseDAO = new BaseDAO();
$loginId = Session::get('userid');

$contentId = $commonUtils->getParameter("id");
$createddate = $commonUtils->getDate();
$comment = $commonUtils->getParameter("cm");
$status = $loginId != null ? 1 : 0; 
if($comment != null && $comment != ""){
	$values = array($contentId, $createddate, $comment, $status, $loginId);
	$baseDAO->create("comment", array("contentid", "createddate", "content", "status", "createdby"), $values);
}
?>